home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Help with writing to stdin (UNIX)
- Date: Sun, 24 Mar 96 16:43:47 GMT
- Organization: none
- Distribution: world
- Message-ID: <827685827snz@genesis.demon.co.uk>
- References: <199603210528.TAA02459@ss20.bnkdp.khabarovsk.su>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <199603210528.TAA02459@ss20.bnkdp.khabarovsk.su>
- igor@bnkdp.khabarovsk.su "Igor Kouznetsov " writes:
-
- >I create a child process (by fork()) and need to insert some input to
- >the stdin (sure, stdin is the same for both parent and child
- >processes) in parent, expecting that it will appear in stdin of
- >child.
-
- Process, fork(), child are Unix concepts and are not relevant to the
- C language. Try comp.unix.programmer.
-
- >I tried to do that,foe example, by direct writing to buffer
- >pointed by according fields of stdin FILE structure, but pointer to
- >buffer associated with stdin turns to be NULL, I can't comprehand
- >why :-(
-
- streams strctures are prurely local to a specific program invocation
- (process).
-
- >I also made some attempts using other methods but they also failed
- >for different reasons, so there's no sense to describe that struggle.
- >
- >A small illustration of the task:
- > ---------- ---------
- > | Parent | | Child |
- > | process | | process |
- >-------->|----------|---->| |
- > stdin | ^ | | |
- > | | | | |
- > | some | | |
- > | input | | |
- > --------- ---------
- ^
- What you have drawn here is a pipe.
-
- >Does anybody have any idea how to realize it?
- >Note: I need NOT a pipe between processes but a way to insert
- >something namely to stdin of child process.
-
- Not possible in general. See comp.unix.programmer for further discusion.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-